import request from '@/utils/request.js'
// 获取员工列表
export function sysUser(params) {
  return request({
    url: '/sys/user',
    params
  })
}
// 新增员工接口
export function addSysUser(data) {
  return request({
    url: '/sys/user',
    method: 'post',
    data
  })
}
// 删除员工接口
export function delSysUser(id) {
  return request({
    url: '/sys/user/' + id,
    method: 'delete'
  })
}
// 新增导入接口
export function sysUserBatch(data) {
  return request({
    url: '/sys/user/batch',
    method: 'post',
    data
  })
}
// 员工个人信息获取
export function employeesPersonalInfo(id) {
  return request({
    url: `/employees/${id}/personalInfo`
  })
}
// 员工信息更新
export function employeesPersonalInfoPut(data) {
  return request({
    url: `/employees/${data.userId}/personalInfo`,
    method: 'put',
    data
  })
}
// 岗位详情
export function employeesJobs(id) {
  return request({
    url: `/employees/${id}/jobs`
  })
}
// 岗位详情更新
export function employeesJobsPut(data) {
  return request({
    url: `/employees/${data.userId}/jobs`,
    method: 'put',
    data
  })
}
// 分配角色
export function sysUserAssignRoles(id, roleIds) {
  return request({
    url: '/sys/user/assignRoles',
    method: 'put',
    data: {
      id,
      roleIds
    }
  })
}
